﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;

public partial class AdminCMS_tab_ArticleBase_Add : System.Web.UI.Page
{    
    int ClassID = 0;
    
    protected void Page_Load(object sender, EventArgs e)
    {
        UIMethod.GetQuery(ref ClassID, "classid");
        if (!IsPostBack)
        {
            DataTable dt = DataEntity.tab_Class.SelectList("0001", -1, false);
            art_FromID.Items.AddRange(GlocalCache.GetProjectNodes_ListItems(dt, 0));
            art_FromID.Items.Insert(0, new ListItem("--选择栏目--", "0"));
            art_FromID.SelectedValue = ClassID.ToString();
        }
    }

    protected void btn_submit_Click(object sender, EventArgs e)
    {
        DataEntity.tab_ArticleBase t = new DataEntity.tab_ArticleBase();
        RequestQuery.SetEntityValues(t, form1);
        t.art_IssuerID = UIMethod.GetUserID();        
        t.Insert();

        StringBuilder sb = new StringBuilder();
        sb.Append("?ClassID=").Append(art_FromID.SelectedValue);
        UIMethod.Confirm("添加成功，继续添加吗？", "location = '" + Request.Path + sb.ToString() +
            "';", "location = 'tab_ArticleBase_List.aspx" + sb.ToString() + "';");
    }
}
